<!DOCTYPE html>
<html lang="en">

<head>
    <!-- BEGIN META -->
    {include file="public/meta"}
    <!-- END META -->

    <!-- BEGIN STYLESHEET-->
    {include file="public/css"}
    <!-- END STYLESHEET-->

    <title>
        {$current_menu['title']} - {$yun_config.title}
    </title>
</head>

<body>
<!-- BEGIN SECTION -->
<section id="container">
    <!-- BEGIN HEADER -->
    {include file="public/header"}
    <!-- END HEADER -->
    <!-- BEGIN SIDEBAR -->
    {include file="public/sidebar"}
    <!-- END SIDEBAR -->
    <!-- BEGIN MAIN CONTENT -->
    <section id="main-content">
        <!-- BEGIN WRAPPER  -->
        <section class="wrapper">
            <!-- TOP MENU ROW  -->
            {include file="public/top_menu"}
            <!-- TOP MENU ROW  -->

            <!-- BEGIN ROW  -->
            <div class="row">
                <div class="col-lg-12">
                    <section class="panel">
                        <header class="panel-heading tab-bg-dark-navy-blue ">
                            <ul class="nav nav-tabs">
                                {volist name="group_list" id="item"}
                                <li {if condition="$item.id eq $group" }class="active" {/if}>
                                    <a val="{:url('config',['group'=>$item.id])}" class="btn config-group">{$item.name}</a>
                                </li>
                                {/volist}
                            </ul>
                        </header>
                        <div class="panel-body">
                            <div class="tab-content">
                                <div class="tab-pane active">
                                    <div class="form">
                                        <form class="cmxform form-horizontal tasi-form" method="post"
                                              action="{:url('config',['group'=>$group])}" enctype="multipart/form-data">
                                            {volist name="group_config" id="item"}
                                            {switch name="$item.form_type"}
                                                {case value="text|number"}
                                                    <div class="form-group">
                                                        <label class="control-label col-sm-2">{$item.title}</label>
                                                        <div class="col-sm-4">
                                                            <input class="form-control" name="{$item.name}" type="{$item.form_type}" value="{$item.value}">
                                                        </div>
                                                        <span class="help-block form-span-tip col-sm-6">*{$item.tip}</span>
                                                    </div>
                                                {/case}
                                                {case value="select"}
                                                    <div class="form-group">
                                                        <label class="control-label col-sm-2">{$item.title}</label>
                                                        <div class="col-sm-4">
                                                            <select class="form-control" name="{$item.name}">
                                                                {volist name="$item.options" id="vo"}
                                                                <option value="{$vo[0]}" {if condition="$item.value eq $vo[0]"}selected="selected" {/if}>{$vo[1]}</option>
                                                                {/volist}
                                                            </select>
                                                        </div>
                                                        <span class="help-block form-span-tip col-sm-6">*{$item.tip}</span>
                                                    </div>
                                                {/case}
                                                {case value="textarea"}
                                                    <div class="form-group">
                                                        <label class="control-label col-sm-2">{$item.title}</label>
                                                        <div class="col-sm-4">
                                                            <textarea class="form-control" name="{$item.name}" rows="5">{$item.value}</textarea>
                                                        </div>
                                                        <span class="help-block form-span-tip col-sm-6">*{$item.tip}</span>
                                                    </div>
                                                {/case}
                                                {case value="checkbox"}
                                                    <div class="form-group">
                                                        <label class="control-label col-sm-2">{$item.title}</label>
                                                        <div class="col-sm-3">
                                                            <input class="form-control" name="{$item.name}" type="checkbox" data-toggle="switch" {if condition="$item.value eq 1"}checked="checked"{/if}>
                                                        </div>
                                                        <span class="help-block form-span-tip col-sm-6">*{$item.tip}</span>
                                                    </div>
                                                {/case}
                                                <!--{case value="picture"}{/case}-->
                                                {case value="editor"}
                                                    <div class="form-group">
                                                        <label for="editor" class="control-label col-sm-2">{$item.title}</label>
                                                        <div class="col-sm-9">
                                                            <textarea type="text" id="editor" name="{$item.name}">{$item.value}</textarea>
                                                        </div>
                                                    </div>
                                                {/case}
                                            {/switch}
                                            {/volist}
                                            <div class="form-group">
                                                <div class="col-sm-offset-2 col-sm-10">
                                                    <button class="btn btn-primary" type="submit">保存</button>
                                                    <button class="btn btn-default" type="reset">重置</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
            <!-- END ROW  -->
        </section>
        <!-- END WRAPPER  -->
    </section>
    <!-- END MAIN CONTENT -->
    <!-- BEGIN FOOTER -->
    {include file="public/footer"}
    <!-- END FOOTER -->
</section>
<!-- END SECTION -->
<!-- BEGIN JS -->
{include file="public/js"}
<!--<script src="__STATIC__/js/yunadmin/config.js"></script>-->
<!-- YunAdmin CONFIG JS -->
<script>
    KindEditor.ready(function (K) {
        window.editor = K.create('#editor', {
            width: '75%',
            height: '250px',
            items: [
                'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
                'plainpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
                'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
                'superscript', 'clearhtml', '|', 'fullscreen', '/',
                'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
                'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
                'selectall', 'table', 'hr', 'emoticons', 'pagebreak',
                'anchor', 'link', 'unlink', '|', 'about'
            ],
            uploadJson: "{:url('admin/uploads/uploadKindEditorImg')}",
            urlType: "domain"
        });
    });

    $(function () {
        $(".config-group").click(function () {
            var url = $(this).attr('val');
            window.location.href = url;
        });
    });
</script>


<!-- END JS -->
</body>

</html>